package com.wjy.icu.domain.form;

import lombok.Data;
import org.apache.ibatis.annotations.Insert;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Description:
 * @author: wangjunyong
 * @date: 2021/6/15 17:03
 */
@Data
public class PhoneFrom {
    @NotBlank(message = "手机号码不能为空", groups = {Insert.class})
    @NotNull(message = "手机号不能为空", groups = {Insert.class})
    @Length(min = 11,max = 11,message = "手机号只能为11位")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式有误")
    private String phone;
}
